FROM registry.jetbrains.team/p/prj/containers/projector-phpstorm:latest
USER root

#RUN  apt-get install -y gnupg2
RUN mkdir -p /var/lib/apt/lists/partial
RUN rm -rf /etc/apt/sources.list
ADD ./sources.list /etc/apt/sources.list
#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys　425956BB3E31DF51
#RUN apt-key --keyserver keyserver.ubuntu.com --recv 5523BAEEB01FA116
#RUN gpg --export --armor 5523BAEEB01FA116 | sudo apt-key add -

# RUN apt-get clean
RUN apt-get clean && apt-get update && apt-get upgrade -y
RUN apt-get install -y zsh vim unzip
RUN apt-get install -y php php-pdo php-xml php-curl php-bcmath php-gd php-mbstring php-iconv  php-zip php-curl
RUN apt-get install -y php-sqlite3 php-xmlwriter php-dom php-sockets php-fileinfo php-posix php-phar php-opcache php-xdebug

# apk add php8
# apk add php8-iconv
# apk add php8-mbstring
# apk add php8-xml
# apk add php8-pdo
# apk add php8-opcache
# apk add php8-gd
# apk add php8-openssl
# apk add php8-fileinfo
# apk add php8-tokenizer
# apk add php8-sockets
# apk add php8-curl
# apk add php8-dom
# apk add php8-xmlwriter
# apk add php8-phar
# apk add php8-pcntl
# apk add php8-posix
# apk add php8-session
# apk add php8-redis
# apk add php8-pdo_mysql
# apk add php8-sqlite3
# apk add php8-pecl-xdebug

RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" &&\
          php composer-setup.php && \
          php -r "unlink('composer-setup.php');" && \
          chmod +x ./composer.phar && mv ./composer.phar /usr/local/bin/composer

 RUN  composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/        
